<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Promise.reject</title>
</head>

<body>
    <script>
        //返回一个失败的 promise 实例对象, 参数值就是返回 promise 的结果值
        // let p1 = Promise.reject(true);
        // let p2 = Promise.reject(new Promise((resolve, reject) => {
        //     resolve('ok');
        // }));

        let p3 = Promise.resolve(Promise.resolve(Promise.reject('ERR')));
        let p4 = Promise.resolve(Promise.reject(Promise.resolve('OK')));

        console.log(p4);
    </script>
</body>

</html>